using MicroMsg.Common.Event;
using System;
using System.Collections.Generic;
using System.Linq;
namespace MicroMsg.Storage
{
	public class ContactStorage : StorageMemory<Contact, string>
	{
		public ContactStorage() : base((Contact c) => c.strUsrName)
		{
		}
		public List<Contact> getByUserNameList(List<string> userNameList)
		{
			if (userNameList != null && userNameList.get_Count() > 0)
			{
				return base.getList(userNameList);
			}
			return null;
		}
		public List<Contact> getListWithOrder()
		{
			return base.getList();
		}
		public Dictionary<string, Contact> getDictionary(List<string> userNameList)
		{
			if (userNameList == null || userNameList.get_Count() <= 0)
			{
				return null;
			}
			List<Contact> list = base.getList(userNameList);
			if (list != null && list.get_Count() > 0)
			{
				return Enumerable.ToDictionary<Contact, string>(list, (Contact contact_0) => contact_0.strUsrName);
			}
			return null;
		}
		public bool method_5(List<string> userNameList)
		{
			if (userNameList != null && userNameList.get_Count() > 0)
			{
				using (List<string>.Enumerator enumerator = userNameList.GetEnumerator())
				{
					while (enumerator.MoveNext())
					{
						string current = enumerator.get_Current();
						base.method_3(current);
					}
				}
				return true;
			}
			return false;
		}
		public bool mergeList(List<Contact> contactList)
		{
			return base.updateList(contactList);
		}
		public override void notify(int operation, Contact item)
		{
			EventCenter.postCombineEvent(EventConst.ON_STORAGE_CONTACT_ADD + operation, item);
		}
		public static void addContact()
		{
		}
		public static void testExpTree()
		{
		}
		public void test11()
		{
			StorageBasic.onLogin("test");
			this.vmethod_0(new Contact
			{
				strUsrName = "aaa"
			});
			Contact contact = new Contact
			{
				strUsrName = "aaa"
			};
			contact.strSnsBGImgID = "bbbb";
			base.update(contact);
			base.method_0("aaa");
		}
		public void test()
		{
			ContactXmlDataSerial contactXmlDataSerial = StorageXml.loadFromFile<ContactXmlDataSerial>("test.xml");
		}
		public void testApi()
		{
			base.dumpTable();
			this.vmethod_0(new Contact
			{
				strUsrName = "444"
			});
			this.vmethod_0(new Contact
			{
				strUsrName = "555"
			});
			this.vmethod_0(new Contact
			{
				strUsrName = "666"
			});
			Contact contact = base.method_0("444");
			if (contact != null)
			{
				contact.strNickName = "uuu";
				base.dumpTable();
			}
			List<Contact> list = new List<Contact>();
			list.Add(new Contact
			{
				strUsrName = "aaa"
			});
			list.Add(new Contact
			{
				strUsrName = "bbb"
			});
			list.Add(new Contact
			{
				strUsrName = "ccc"
			});
			list.Add(new Contact
			{
				strUsrName = "ddd"
			});
		}
	}
}
